package com.bjc.base.core;

import lombok.Getter;
import lombok.Setter;

/**
 * 自定义异常
 *
 * @author 许自辉
 * @date 2017年7月18日
 */
@Getter
@Setter
public class MyException extends RuntimeException {

	private static final long serialVersionUID = 7150212192510822852L;

	private Integer code;

	/**
	 * 统一异常信息枚举定义
	 * 
	 * @param resultEnum
	 */
	public MyException(ResultEnum resultEnum) {
		super(resultEnum.getMessage());
		this.code = resultEnum.getCode();
	}

	public MyException() {
	}

	public MyException(String message) {
		super(message);
	}

	public MyException(String message, Throwable cause) {
		super(message, cause);
	}
}
